package com.example.demo5.service.impl;

import com.example.demo5.dao.UserDao;
import com.example.demo5.entity.User;
import com.example.demo5.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @auther: xhd
 * @Date: 2020/9/1/11:12
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

//    @Override
//    public List<User> queryByAge(int age) {
//        return userDao.findByAge(age);
//    }

    @Override
    public User save(User user) {

        return userDao.save(user);
    }


    @Override
    public void deletUserById(int id) {

        userDao.deleteById(id);
    }

    @Override
    public User queryById(int id) {

        return userDao.findById(id);
    }
}
